<?php
require_rewrite(SYSTEM_PATH . 'config/sms_config.php');
/**
 * Description of SMS
 * @author Quan
 */
class SMS {
    public static function send($msg, $mobile, $userId=1){
        $msg = trim($msg);
        if( empty($userId) || empty($msg) || empty($mobile) ){
            return false;
        }
        if( !Handler_validate::checkPhone($mobile) ){
            return false;
        }

	$param = array(
            'userId' =>$userId,
            'smsInfo' => $msg,
            'mobileNum' =>$mobile
	);
	$mess_res = Handler_curl::get_data_from_rpc(SMSConfig::$interface_url, 'InsertSms', $param);
	return true;
    }
}
?>
